package FlowGraph.Nodes;

import antlr.collections.AST;

import util.Line;
import FlowGraph.FlowGraphNode;

//////////////////////////////////////////////////////////////////////////
//// DoBeginNode
/**

@author Ivan Jeukens
@version v 0.1 03/10/2001
*/
public class DoBeginNode extends FlowGraphNode {

    public DoBeginNode(AST statement) {
        super(statement, DO_BEGIN, 1, 1);
        _condition = statement.getFirstChild();
        _condition = _condition.getNextSibling();
    }

    ///////////////////////////////////////////////////////////////////
    ////                        public methods                     ////

    public String toString() {
        return new String("do...");
    }

    public void setDoEnd(DoEndNode node) {
        _doEnd = node;
    }
    
    public DoEndNode getDoEnd() {
        return _doEnd;
    }

    public AST getCondition() {
        return _condition;
    }

    public void setBegLine(Line l) {
        _begLine = l;
    }

    public Line getBegLine() {
        return _begLine;
    }

    public void setConditionLine(Line l) {
        _conditionLine = l;
    }

    public Line getConditionLine() {
        return _conditionLine;
    }
    
    public void setConditionNode(DoConditionNode node) {
        _condNode = node;
    }

    public DoConditionNode getConditionNode() {
        return _condNode;
    }
    
    public void setIterations(int ite) {
        _iterations = ite;
    }

    public int getIterations() {
        return _iterations;
    }
    
    ///////////////////////////////////////////////////////////////////
    ////                      private variables                    ////

    private AST _condition;

    private DoConditionNode _condNode;
    private DoEndNode _doEnd;
    private Line _begLine;
    private Line _conditionLine;
    
    private int _iterations;
}
